import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import org.antlr.v4.runtime.ANTLRFileStream;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.ParseTreeWalker;

import Parser.*;
public class Wezlang {

	public static void main(String[] args) {
	    WezlangLexer lexer;
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String antlr_in = br.readLine();
			lexer = new WezlangLexer(new ANTLRFileStream(antlr_in));
		    CommonTokenStream tokens = new CommonTokenStream(lexer);
		    WezlangParser p = new WezlangParser(tokens);
		    p.setBuildParseTree(true);
		    ParseTreeWalker walker = new ParseTreeWalker();
		    Symbol_Tree sym_tree = new Symbol_Tree();
		    walker.walk(sym_tree, p.prog());
		    System.out.println(sym_tree);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
}